package com.googlecode.beanfiles;


public class SimpleBean {

    private String property1;
    private String property2;
    private String property3;
    private int property4;
    private boolean property5;

    public SimpleBean() {}

    public String getProperty1() {
        return property1;
    }

    public void setProperty1(String property1) {
        this.property1 = property1;
    }

    public String getProperty2() {
        return property2;
    }

    public void setProperty2(String property2) {
        this.property2 = property2;
    }

    public String getProperty3() {
        return property3;
    }

    public void setProperty3(String property3) {
        this.property3 = property3;
    }

    public int getProperty4() {
        return property4;
    }

    public void setProperty4(int property4) {
        this.property4 = property4;
    }

    public boolean isProperty5() {
        return property5;
    }

    public void setProperty5(boolean property5) {
        this.property5 = property5;
    }
    
    public boolean equals(Object o) {
        if (!(o instanceof SimpleBean)) {
            return false;
        }
        SimpleBean bean = (SimpleBean) o;
        if (!bean.getProperty1().equals(getProperty1())) {
            return false;
        } else if (!bean.getProperty2().equals(getProperty2())) {
            return false;
        } else if (!bean.getProperty3().equals(getProperty3())) {
            return false;
        } else if (bean.getProperty4() != getProperty4()) {
            return false;
        } else if (bean.isProperty5() != isProperty5()) {
            return false;
        }
        return true;
    }
    
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("[property 1: " + getProperty1() + "]");
        builder.append("[property 2: " + getProperty2() + "]");
        builder.append("[property 3: " + getProperty3() + "]");
        builder.append("[property 4: " + getProperty4() + "]");
        builder.append("[property 5: " + isProperty5() + "]");
        return builder.toString();
    }

}
